// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   ServletTest.java

package cn.itcast.web04.request;

import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.http.*;

public class ServletTest extends HttpServlet
{

    public ServletTest()
    {
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
    {
        response.setContentType("text/html);charset=utf-8");
        String value = request.getParameter("username");
        String newValue = new String(value.getBytes("ISO8859-1"), "utf-8");
        response.getWriter().print((new StringBuilder("")).append(newValue).toString());
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
    {
        request.setCharacterEncoding("utf-8");
        String value = request.getParameter("username");
        System.out.println(value);
        response.setContentType("text/html);charset=utf-8");
        PrintWriter out = response.getWriter();
        out.print(value);
    }

    private static final long serialVersionUID = 1L;
}
